#! /usr/bin/python
# -*- coding: cp1250 -*-
# mvdt.py

import time, shutil, sys, os
import pepe.p_oslevel.basic as wai

whereami = wai.wai()

#itn = lambda : time.strftime ("%Y-%m-%dT%H%M%S", time.localtime()) # iso time now
#itn = lambda : time.strftime ("%Y%m%d-%H%M", time.localtime()) # iso time now
itn = lambda : time.strftime ("%Y-%m-%d_%H%M", time.localtime()) # iso time now

def mvdt(sargv):
    p,f  = os.path.split(sargv[1]) # path, file
    pf = whereami + sargv[1] # path + file
    err = '''
    Syntax: mvdt <file/folder>
    or file/folder %s was not found in path %s
    '''
    if len(sargv) == 2:
        a = whereami + sargv[1]
        b = "%s%s%s" % (whereami, itn(), f)
        '''
        print '*'*20
        print a
        print b
        print '*'*20
        '''
        shutil.move(a, b)
    else:
        print err % (f,p)
	
if __name__ == '__main__':
    ''' '''
    #print whereami
    #print sys.argv
    mvdt(sys.argv)
